#pragma once

#include <atomic>
#include <memory>
#include <string>
#include <vector>
#include "base_noncopyable.h"
#include "record_search.h"

namespace El {
namespace Record {

class CRecordSearch : public IRecordSearch {
public:
    CRecordSearch();

    ~CRecordSearch() = default;

    bool searchVideo(int32_t ch, TimePoint start, TimePoint end) override;
    bool findNextVideo(int32_t count, int32_t &found, std::vector<VideoFileInfo> &fileList) override;
    bool closeVideo() override;

    bool searchImage(int32_t ch, TimePoint start, TimePoint end) override;
    bool findNextImage(int32_t count, int32_t &found, std::vector<ImageFileInfo> &fileList) override;
    bool closeImage() override;

private:
    std::string storePath_{"/mnt/udisk"};
    std::vector<VideoFileInfo> searchResults_;
    std::vector<ImageFileInfo> imageResults_;
    size_t currentIndex_{0};
    size_t imageIndex_{0};
};

} // namespace Record
} // namespace El